package com.cnunicom.modules.business.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cnunicom.common.utils.PageUtils;
import com.cnunicom.common.utils.Query;

import com.cnunicom.modules.business.dao.BusinessDeptDao;
import com.cnunicom.modules.business.entity.BusinessDeptEntity;
import com.cnunicom.modules.business.service.BusinessDeptService;


@Service("businessDeptService")
public class BusinessDeptServiceImpl extends ServiceImpl<BusinessDeptDao, BusinessDeptEntity> implements BusinessDeptService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String name = (String) params.get("deptName");
        IPage<BusinessDeptEntity> page = this.page(
                new Query<BusinessDeptEntity>().getPage(params),
                new QueryWrapper<BusinessDeptEntity>().like(StringUtils.isNotBlank(name),"name",name)
        );

        return new PageUtils(page);
    }

}
